/* eslint-disable no-unused-vars */
import { drawNode, setRectColor, isRecordingFinished } from './utility';
const name = 'startSystemRecording';
const attr = {
	rectColor: '#F6A3A1'
};

const drawShape = function (parentNode, element, textRenderer, eventBus, store) {
	const taskId = element.businessObject.taskId || element.id;

	attr.title = `流程${taskId.split('_')[1]} 开始双录`;
	attr.content = '请编辑开始双录模版';

	if (isRecordingFinished(store, taskId)) {
		attr.content = '开启双录';
	}

	if (store.state.workflow.worksteps[taskId]) {
		attr.rectColor = setRectColor(store, taskId);
		attr.desc = store.state.workflow.worksteps[taskId].name || '';
	}

	return drawNode(parentNode, element, textRenderer, eventBus, attr);
};

export default {
	drawShape,
	name: name
};
